package nl.hr.minor.mobilelife.j1213.jlr.flow;

import android.graphics.Canvas;
import android.graphics.Paint;
import android.graphics.Rect;
import android.graphics.RectF;

public class Block extends RectF {

	public static Paint blockPaint;
	public int row, column;
	
	public Block() {
		super();
	}

	public Block(float left, float top, float right, float bottom) {
		super(left, top, right, bottom);
	}
	
	public Block(int row, int column, float left, float top, float right, float bottom) {
		super(left, top, right, bottom);
		this.row = row;
		this.column = column;
	}
	
	public Block(int row, int column) {
		super();
		this.row = row;
		this.column = column;
	}

	public Block(Rect r) {
		super(r);
	}

	public Block(RectF r) {
		super(r);
	}
	
	@Override
	public boolean equals(Object other) {
		try {
			Block b = (Block) other;
			return this.row == b.row && this.column == b.column;
		} catch(Exception e) {
			return false;
		}
	}
	
	public void draw(Canvas c){
		c.drawRect(this, blockPaint);
	}
	
	@Override
	public String toString() {
		return "Block(row: " + row + ", col: " + column + ") extends: " + super.toString();
	}
}